package com.dragon.app.other;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.SynchronousQueue;

public class T4 {

	public static void main(String[] args) {
		List list = new ArrayList<>();
		list.add("sdfsf");
		list.add(null);
		list.add("yertyert");
		list.add(null);
		list.add("rtyshfs");
		System.out.println(list);
		
		Map map = new HashMap<>();
		map.put("sf", "asfasfa");
		map.put(null, "shrtywrtye");
		map.put("rtyrwy", "ytrurty");
		map.put(null, "空");
		System.out.println(map);
		
		BlockingQueue queue = new SynchronousQueue<>();
		
		new Thread(()->{
			try {
				queue.put("hello........");
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}).start();
		
		new Thread(()->{
			try {
				System.out.println(queue.take());
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}).start();
		

	}

}
